package cn.tedu.spring.cat;

import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

/**
 * Author：程Sir
 * Name： SpringTest01
 * Content:
 */
// 添加了@Component组件，表示当前的类是可以被spring扫描，并添加到spring容器中的！
//@Component(value = "xiaohua")
//    @Controller("小花")
    @Service
public class Cat {
    private Integer age = 15;
    private String name ="小花";

    private String color="黑色";

    // 还可以创建构造方法来进行实例化属性值
//    public Cat(Integer a){
//
//    }
    @Override
    public String toString() {
        return "Cat{" +
                "age=" + age +
                ", name='" + name + '\'' +
                ", color='" + color + '\'' +
                '}';
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}
